<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2018/1/10
 * Time: 10:44
 * 删除管理员
 */
include_once 'admin_global.php';        //加载后台统一调用类文件
$db->Get_user_shell_check($uid, $shell);   //检测用户是否登录
//删除用户
$userID = $_GET['userID'];
if ($userID == $uid) {
    echo "<script>alert('该用户正在使用中，无法删除！');window.location.href='listAdmin.php'</script>";
} else {
    $sql = "DELETE FROM admin WHERE userID='$userID'";
    $query = $db->query($sql);
    if ($query == true) {
        echo "<script>alert('删除成功');window.location.href='listAdmin.php'</script>";
    } else {
        echo "<script>alert('删除失败');window.location.href='listAdmin.php'</script>";
    }
}